package cn.ywang.spring.framework.aop.intercept;

import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;

/**
 * @author BeatificWang
 * @date 2019/5/4 21:38
 */
public interface Joinpoint {


	/**
	 * Proceed to the next interceptor in the chain.
	 * <p>The implementation and the semantics of this method depends
	 * on the actual joinpoint type (see the children interfaces).
	 *
	 * @return see the children interfaces' proceed definition
	 * @throws Throwable if the joinpoint throws an exception
	 */
	Object proceed() throws Throwable;

	/**
	 * Return the object that holds the current joinpoint's static part.
	 * <p>For instance, the target object for an invocation.
	 *
	 * @return the object (can be null if the accessible object is static)
	 */
	Object getThis();

	/**
	 * Return the static part of this joinpoint.
	 * <p>The static part is an accessible object on which a chain of
	 * interceptors are installed.
	 */
	AccessibleObject getStaticPart();

	Object[] getArguments();

	Method getMethod();

	void setUserAttribute(String key, Object value);

	Object getUserAttribute(String key);

}
